﻿using UnityEngine;
using System.Collections;

namespace IMIForUnity
{

    public struct ImiResolution
    {
        public enum Type
        {
            INVALID = -1,
            _320x240 = 0,
            _640x480 = (_320x240 + 1),
            _1280x720 = (_640x480 + 1),
            _1920x1080 = (_1280x720 + 1)
        }

        private Type _type;
        public Type type{ get { return this._type; } set { this._type = value; } } 

        public int Height
        {
            get
            {
                switch (_type)
                {
                    case Type._320x240:
                        return 240;
                    case Type._640x480:
                        return 480;
                    case Type._1280x720:
                        return 720;
                    case Type._1920x1080:
                        return 1080;
                    default:
                        return 0;
                }
            }
        }
        public int Width
        {
            get
            {
                switch (_type)
                {
                    case Type._320x240:
                        return 320;
                    case Type._640x480:
                        return 640;
                    case Type._1280x720:
                        return 1280;
                    case Type._1920x1080:
                        return 1920;
                    default:
                        return 0;
                }
            }
        }

        public int Size
        {
            get { return Height * Width; }
        }
    }

}